import { ElLoading, ElLoadingService } from "element-plus";

let loading : any;
export const open = (text ?: string) => {
    loading = ElLoading.service({
        lock : true,
        text : text || '处理中...',
        background: 'rgba(0, 0, 0, 0.7)',
        target : document.body
    });
};

export const close = () => {
    loading && loading.close();
    loading = null;
}